package com.cskaoyan.chapter0502.c050205;

import java.math.BigDecimal;

/**
 * @Author:WalterChan
 * @Decription:Manager
 * @Date Created in 2024-05-28-19:45
 */
public class Manager extends Employee {
    private BigDecimal bonus;

    public BigDecimal getBonus() {
        return bonus;
    }

    public void setBonus(BigDecimal bonus) {
        this.bonus = bonus;
    }
    public   BigDecimal getSalary(){

        return this.bonus.add(super.getSalary());
    }

//    @Override
    public boolean equals(Object obj) {
        if (!super.equals(obj)){
            return false;
        }
        Manager other=(Manager)obj;
        return other.getBonus().compareTo(this.getBonus())==0;
    }

    @Override
    public String toString() {
        return super.toString()+bonus.toString();
    }
}
